using System;
using NHibernate;

namespace Genrsis.Data.NHibernate
{
    public class NHibernateDataSessionFactory : IDataSessionFactory
    {
        private readonly ISessionFactory _sessionFactory;

        public NHibernateDataSessionFactory(ISessionFactory sessionFactory)
        {
            _sessionFactory = sessionFactory;
        }

        public IDataSession Create()
        {
            return new NHibernateDataSession(_sessionFactory.OpenSession());
        }
    }
}